<div class="content-titulo">
    
    <div class="filtro">
        <form id="form_filtro" method="get" action="">
            <i>Filtrar</i>
            
            <input type="text" name="dscfiltro" value="<?php echo $this->dscfiltro; ?>" placeholder="Título" />
            
            <input type="submit" class="btn-pdr" name="buscar" value="buscar" />
        </form>
    </div>
    
    
    <div class="content-btn">
        <a href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'edit', 'for_id' => $this->for_id, 'mat_id' => $this->mat_id,'id' =>'')); ?>">+</a>
    </div>
    
    <h2><?php echo $this->titulo;?></h2>
</div>


<div class="content-list">
    
<?php foreach ($this->result as $row) {  ?>
    <div class="item" style="height:100px">    
        <div class="col" style="width: 200px">
            <p><strong>Código: <?php echo $row['COR_ID']; ?></strong></p>
            <p><strong>Título: </strong><?php echo $row['COR_NOM']; ?></p> 
            <p><strong>Status: </strong><?php echo tools::returnStatus($row['COR_STA']); ?></p>
        </div>
        <div class="col" style="width: 200px">
            <p><strong>Referência: </strong><?php echo $row['COR_REF']; ?></p>
            <p><strong>Cor: </strong><?php 
				$img = glob('public/upload/cor/'.$row['COR_ID'].'.*');
				if(!isset($img[0])) echo $row['COR_COR']; 
			?></p>
			<ul class="grade_cor">
                <?php if(!isset($img[0])) { ?>
				<li style="background-color: #<?php echo $row['COR_COR']; ?>"></li>
				<?php } else{ 
					echo '<img src="'.$this->urlbase.'/'.$img[0].'" style="border: 1px solid #333;" />';
				 } ?>
            </ul>
        </div>
        
        <div class="col" style="width: 150px">
            
        </div>
        
       
        
        <div class="btn-actions" style="padding-top: 10px;">
            <?php if($this->per_edt){?><a class="btn-pdr" href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'edit', 'id' => $row['COR_ID'], 'for_id' => $this->for_id, 'mat_id' => $row['MAT_ID'])); ?>">Editar</a><?php }?>
            <?php if($row['COR_STA'] == 0){?><a class="btn-pdr" href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'delete', 'id' => $row['COR_ID'], 'for_id' => $this->for_id, 'mat_id' => $row['MAT_ID'])); ?>" >Deletar</a><?php }?>            
        </div>

      </div>
    <?php } ?>
</div>
<?php echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml'); ?>

<a href="<?php echo $this->voltar; ?>">Voltar para Material</a>

